﻿<ValueConversion(GetType(Boolean), GetType(Brush))> _
Public Class IsActiveToBrushConverter
    Implements IValueConverter


    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        If value IsNot Nothing AndAlso TypeOf value Is Boolean Then
            If CType(value, Boolean) Then
                Return New SolidColorBrush(Colors.Black)
            Else
                Return New SolidColorBrush(Colors.LightGray)
            End If
        Else
            Return New SolidColorBrush(Colors.LightGray)
        End If
    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Throw New NotImplementedException
    End Function
End Class
